package com.wallet.admin.feign.system;

import com.wallet.common.vo.PageResult;
import com.wallet.provider.model.Role;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.List;

@FeignClient("wallet-provider-sys")
public interface RoleFeignClient {

    /**
     * 分页查询角色
     * @param keywords
     * @param pageNum
     * @param pageSize
     * @param orderName
     * @param orderType
     * @return
     */
    @RequestMapping(value = "/getRoleList", method = RequestMethod.GET)
    PageResult<Role> getRoleList(@PathVariable("keywords") String keywords, @PathVariable("pageNum") int pageNum, @PathVariable("pageSize") int pageSize,@PathVariable("orderName") String orderName, @PathVariable("orderType") String orderType);

    /**
     * 添加角色
     * @param role
     */
    @RequestMapping(value = "/addRole", method = RequestMethod.POST)
    Boolean addRole(Role role);

    /**
     * 根据id删除角色
     * @param ids
     * @return
     */
    @RequestMapping(value = "/deleteRole", method = RequestMethod.POST)
    Boolean deleteRole(String ids);

    /**
     * 根据id查询角色
     * @param id
     * @return
     */
    @RequestMapping(value = "/getRoleById", method = RequestMethod.GET)
    Role getRoleById(Long id);

    /**
     * 根据userId查询角色
     * @param id
     * @return
     */
    @RequestMapping(value = "/getRoleByUserId", method = RequestMethod.GET)
    List<Role> getRoleByUserId(Long id);

    /**
     * 修改角色
     * @param role
     * @return
     */
    @RequestMapping(value = "/updateRole", method = RequestMethod.POST)
    Boolean updateRole(Role role);

    @RequestMapping(value = "/getAllRoleList", method = RequestMethod.GET)
    List<Role> getAllRoleList();
}
